package com.zhaoyu.user.feign.article;

import com.zhaoyu.model.article.pojos.ApAuthor;
import com.zhaoyu.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("leadnews-article") // 这里的名字要和服务名称/配置文件名字一致
public interface ArticleFeign {

    @GetMapping("/api/v1/author/findByUserId/{id}")
    ApAuthor findByUserIdApAuthor(@PathVariable("id") Integer id);

    @PostMapping("/api/v1/author/save")
    ResponseResult saveApAuthor(@RequestBody ApAuthor apAuthor);

    @GetMapping("/api/v1/author/findById/{id}")
    ApAuthor findByIdApAuthor(@PathVariable("id") Integer id);

}